< previous page page_418 next page >

Page 418
Type.gifListing 11.3. Adding code to the cmdQuickData_Click event.
Private Sub cmdQuickData_Click()
    '
    ' show quickdata method for building graphs
    '
    Dim strData As String
    '
    ' create three sets of data, each with four points
    '
    strData = "1" & vbTab & "2" & vbTab & "3" & vbTab & "4" & vbCrLf
    strData = strData & "5" & vbTab & "4" & vbTab & "3" & vbTab & "2" & vbCrLf
    strData = strData & "6" & vbTab & "8" & vbTab & "10" & vbTab & "4" & vbCrLf
    '
    Graph1.GraphType = gphLine
    Graph1.DataReset = gphAllData
    Graph1.QuickData = strData
    '
    Graph1.DrawMode = gphDraw
    '
End Sub
Notice that you created a list of data that contained three sets of four points each. When you use the QuickData property, the graph control is able to determine the total number of sets and the number of points in each set without using the NumSets and NumPoints properties. Save and run this project. Your screen should look like the one shown in Figure 11.6.
0418-01.jpg
Figure 11.6.
Adding graph data using the QuickData property.

 
< previous page page_418 next page >

If you like this book, buy it!